package com.clayecloud.lib_common.utils;

import com.google.gson.Gson;

import java.lang.reflect.Type;

public class GsonUtil {
    private static Gson instance= new Gson();
    private GsonUtil(){}
    public static Gson getInstance(){
        return instance;
    }
    //根据泛型返回解析制定的类型
    public  <T> T fromToJson(String json, Type listType){
        Gson gson = new Gson();
        T t = null;
        t = gson.fromJson(json,listType);
        return t;
    }
}
